using System;
using System.Collections.Generic; 
using System.Linq;  
using System.Text;  
using System.Data.Linq.Mapping;
using System.ComponentModel;
using System.Data.Linq;
namespace MRSite.Entity  
{
     [Table(Name = "News_comment")]
    public class NewsComment : Entity
	{ 
		/// <summary>
		///
		/// </summary>
		[Column(Name = "id", IsPrimaryKey = true, CanBeNull = false, IsVersion = true)]
		public override int id{ get; set; } 

		/// <summary>
		/// 新闻ID
		/// </summary>
        [Column(Name = "news_id")]
        public int news_id { get; set; } 

		/// <summary>
		///父评论ID
		/// </summary>
		[Column(Name = "parent_id")]
		public int parent_id{ get; set; } 

		/// <summary>
		///用户ID
		/// </summary>
		[Column(Name = "user_id")]
		public int user_id{ get; set; } 

		/// <summary>
		///用户名
		/// </summary>
		[Column(Name = "user_name")]
		public String user_name{ get; set; } 

		/// <summary>
		///用户IP地址
		/// </summary>
		[Column(Name = "user_ip")]
		public String user_ip{ get; set; } 

		/// <summary>
		///评论内容
		/// </summary>
		[Column(Name = "contents")]
		public String contents{ get; set; } 

		/// <summary>
		///评论时间
		/// </summary>
		[Column(Name = "add_time")]
		public DateTime add_time{ get; set; } 

		/// <summary>
		///是否锁定
		/// </summary>
		[Column(Name = "is_lock")]
		public int is_lock{ get; set; } 

		/// <summary>
		///是否已回复
		/// </summary>
		[Column(Name = "is_reply")]
		public int is_reply{ get; set; } 

		/// <summary>
		///回复内容
		/// </summary>
		[Column(Name = "reply_content")]
		public String reply_content{ get; set; } 

		/// <summary>
		///回复时间
		/// </summary>
		[Column(Name = "reply_time")]
		public DateTime? reply_time{ get; set; }

        /// <summary>
        ///赞
        /// </summary>
        [Column(Name = "likes"), DefaultValue(0)]
        public int likes { get; set; }
         
        /// <summary>
        ///踩
        /// </summary>
        [Column(Name = "dislike"), DefaultValue(0)]
        public int dislike { get; set; }

         /// <summary>
        ///评分
        /// </summary>
        [Column(Name = "grade"), DefaultValue(0)]
        public int grade { get; set; }

        /// <summary>
        ///频道ID
        /// </summary>
        [Column(Name = "channel_id")]
        public int channel_id { get; set; }

        private EntityRef<Customer> _member;
        [Association(OtherKey = "id", Storage = "_member", ThisKey = "user_id")]
        public Customer CustomerItem
        {
            get
            {
                return this._member.Entity;
            }
            set
            {
                this._member.Entity = value;
            }
        }


        private EntityRef<News> _newsItem;
        /// <summary>
        /// 商品类别,外键
        /// </summary>
        [Association(Storage = "_newsItem", ThisKey = "news_id", OtherKey = "id")]
        public News NewsItem
        {
            get { return this._newsItem.Entity; }
            set { this._newsItem.Entity = value; }
        }
	 } 
}    


